package com.yh.dao;

import com.yh.entity.Student;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @Autor:lxy
 * @Date:2021/8/1620:13
 * @Desc：
 */
public interface StudentDao extends JpaRepository<Student,Integer> {
    Student findStudentById(Integer id);

    @Query(name = "findStuByName",nativeQuery = true,value =
            "select * from student where name=:name")
    List<Student> findStuByName(@Param("name") String name);

}
